<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sq="http://www.w3.org/1999/html">
<head>
  <th:block th:include="include :: header"/>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
  <div class="ibox float-e-margins">
    <!--<div class="ibox-title">
      <h5>数据检索</h5>
      <div class="ibox-tools">
        <a class="collapse-link">
          <i class="fa fa-chevron-up"></i>
        </a>
      </div>
    </div>-->
    <div class="ibox-content">
      <form id="searchForm" name="searchForm" role="form" class="sq-searchForm">
        <div class="row">
          <div class="col-sm-3">
            <div class="form-group">
              <input type="text" placeholder="请输入分类编码" name="classCode" class="form-control">
            </div>
          </div>
          <div class="col-sm-3">
            <div class="form-group">
              <input type="text" placeholder="请输入分类名称" name="className" class="form-control">
            </div>
          </div>
          <div class="col-sm-3">
            <div class="form-group">
              <sq:select name="status" dicCode="1001" pleaseChoose="字典状态"/>
            </div>
          </div>
          <div class="col-sm-3" align="right">
            <button onclick="search()" class="btn btn-primary" type="button">
              <i class="fa fa-search"></i>&nbsp;搜索
            </button>
            <button onclick="reset()" class="btn btn-primary btn-outline" type="button">
              <i class="fa fa-recycle"></i>&nbsp;重置
            </button>
          </div>
        </div>
      </form>
    </div>
    <div class="ibox-content">
      <div class="row row-lg">
        <div class="col-sm-12">
          <div class="example-wrap">
            <div id="toolbar" class="form-group sq-toolbar">
              <button onclick="add()" class="btn btn-primary" type="button">新增</button>
              <button onclick="edit()" class="btn btn-warning" type="button">编辑</button>
              <button onclick="del()" class="btn btn-danger" type="button">删除</button>
            </div>
            <div class="example">
              <table id="dataTable"></table>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
</body>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    const requestPath = parent.api.sys.dic
    $(function () {
        let columns = [
            {
                field: "select",
                checkbox: true,//选择框
            }, {
                title: "分类编码",//标题
                field: "classCode",//键名
            }, {
                title: "分类名称",
                field: "className"
            }, {
                title: "字典编码",
                field: "dataCode"
            }, {
                title: "字典名称",
                field: "dataName"
            }, {
                title: "排序",
                field: "dataOrder"
            }, {
                title: "状态",
                field: "status",
                formatter: function (value, row, index) {
                    return parent.formartDic(value, "1001")
                }
            }
        ]
        initTable(columns)
    })
</script>
</html>
